package com.abc.invoke.server.service.impl;

import com.abc.invoke.bean.User;
import com.abc.invoke.bean.UserSessionToken;
import com.abc.invoke.server.db.session.SpringInvokerBackendSession;
import com.abc.invoke.server.service.InterNexusInterface;
import com.abc.invoke.services.interfaces.UserInterface;

public class UserSubNexus implements UserInterface {
    
	private InterNexusInterface nexus;
	public UserSubNexus(InterNexusInterface interNexus){
		this.nexus=interNexus;
		System.out.println("UserSubNexus init");
	}
	
    public User getUserbyName(String name) {
        User u = new User();
        u.setName(name);
        u.setEmail("abc@abc.com");
        u.setAge(20);
        return u;
    }

	@Override
	public User loadUserProfile(UserSessionToken userToken, String name) {
		// TODO Auto-generated method stub
		SpringInvokerBackendSession session=nexus.getSession(userToken);
		return session.getUserBackend().loadUserProfile(name);
		
	}
    
}